package ru.rchervot.sanasar.client.view;

import ru.rchervot.sanasar.client.place.PlaceHistoryCandidates;
import ru.rchervot.sanasar.client.place.PlaceSearchCandidates;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public abstract class AbstractSectionsView extends Composite implements SectionsPresenter.Display {
	
	protected final VerticalPanel contentPanel = new VerticalPanel();
	private SectionsPresenter presenter;
	
	Hyperlink linkHistory = new Hyperlink();
	Hyperlink linkResults = new Hyperlink();
	
	public AbstractSectionsView() {
		super();		
		
		contentPanel.setStylePrimaryName("AbstractSectionsView_content");
		
		linkHistory.setText("Search History");
		linkHistory.setTargetHistoryToken(PlaceHistoryCandidates.historyTokenDefault());

		linkResults.setText("Search Results");
		linkResults.setTargetHistoryToken(PlaceSearchCandidates.historyTokenDefault());
		
		contentPanel.add(linkHistory);
		contentPanel.add(linkResults);
		contentPanel.add(new Label("Starred"));
		contentPanel.add(new Label("CallBack"));
		contentPanel.add(new Label("Trash"));
		
		this.initWidget(contentPanel);
	}
	
	@Override
	public void setPresenter(SectionsPresenter presenter) {
		this.presenter = presenter;
	}
}
